import { Drawer, Tabs } from "antd";
import type { IChannel } from "~/types/manage/channel/list";
import ChannelTags from "./config/channel-tags";

interface Props {
  visible: boolean;
  channel: IChannel | null;
  onClose?: () => void;
}

export default function ChannelConfigDrawer(props: Props) {
  const _handler = {
    onClose: () => {
      props.onClose?.();
    },
  };

  return (
    <Drawer
      title={props.channel?.name || "渠道配置"}
      closable={{ "aria-label": "Close Button" }}
      onClose={_handler.onClose}
      open={props.visible}
      width={1000}
    >
      <div className="h-full w-full overflow-hidden">
        <Tabs
          defaultActiveKey={"channelApis"}
          tabPosition={"left"}
          className="h-full w-full"
          
          items={[
            {
              key: "channelApis",
              label: "接口地址",
              children: "",
            },
            {
              key: "channelTags",
              label: "内容标签",
              children: <ChannelTags channel={props.channel} />,
            },
          ]}
        />
      </div>
    </Drawer>
  );
}
